#!/usr/bin/env bash

if [[ $(uname -s) == 'Darwin' ]]; then
  echo "Directly finish network for macOS development"
  exit 0;
fi

NETWORK_ID=$(docker network ls -q -f name=srs-cloud)
if [[ -z $NETWORK_ID ]]; then
  docker network create -d bridge srs-cloud
  if [[ $? -ne 0 ]]; then echo "Create docker network failed"; exit 1; fi
  echo "Create docker network srs-cloud ok"
else
  echo "Docker network NETWORK_ID=${NETWORK_ID} is ok"
fi

